<!doctype html>
<html>
<head>
<script src="js/jquery.js"></script>
<link href="css/css.css" rel="stylesheet" type="text/css">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="format-detection" content="telephone=no" />
<meta charset="utf-8">
<title>无标题文档</title>
<style>
/*地址输入框*/
.column_box input{ line-height:46px; color:#191919; font-size:14px; float:left; margin-left:12px;}
</style>
</head>

<body style="background-color: #f9f9f9;">
<!--header顶部标题-->
<div class="header">添加服务地址
	<div class="header_left" onclick="window.history.go(-1)"><img src="images/return.png"></div>
</div>
<!--column搜索小区-->
<?php $id=$_GET;?>
<?php if($users==null){?>
<div class="column_box" onclick="document.location='address_search?id=<?php echo $id['id']?>';">
	<div class="border_top"></div>
	<div class="column_img"><img src="images/adrress.png"></div>
    <p>搜索小区</p>
    <div class="next"><img src="images/arrow.png"></div>
    <div class="border_bottom"></div>
</div>
<?php }else{?>
<div class="column_box" onclick="document.location='address_search?id=<?php echo $id['id']?>';">
	<div class="border_top"></div>
	<div class="column_img"><img src="images/adrress.png"></div>
    <p class="site">{{$users->site}}</p>
    <p class="site">{{$users->site_two}}</p>
    <div class="next"><img src="images/arrow.png"></div>
    <div class="border_bottom"></div>
</div>
<?php }?>
<!--column详细地址-->
<div class="column_box">
	<div class="column_img"><img src="images/adrress_2.png"></div>
    <input placeholder="详细地址，如xx号楼xx单元xx室" name="site"></input>
    <div class="border_bottom"></div>
</div>
<!--acreage面积-->

<!--column联系人-->
<div class="column_box">
	<div class="column_img"><img src="images/people.png"></div>
    <input placeholder="联系人" name="user_id"></input>
    <div class="border_bottom"></div>
</div>
<!--column电话-->
<div class="column_box">
	<div class="column_img"><img src="images/phone.png"></div>
    <input placeholder="联系电话" type="number" name="tel"></input>
    <div class="border_bottom"></div>
</div>
<!--confirm确认添加-->
	<div class="confirm" onclick="adders()" >确认添加</div>
    <!-- <input class="submit" type="button" onclick="login()" name="submit" value="立即登录" > -->
    <script src="js/jquery-1.8.3.min.js"></script>
<script>
function adders(){
        var ss=$(".site").text();
		let data = $("input").serializeArray(); //输出数组
		$.ajax({
        url:'adders',
        data:{data,ss},
        success:function(res){
			if(res.code==0){
				alert(res.msg);
			}else if(res.code==1){
				//alert(res.msg);

				location.href = 'address?id=<?php echo $id['id']?>';
			}
		}});
	}

var i=0;
var x=0;
$(".area_box").click(function(){//点击下拉列表

	if(i==0){$(".area_box").animate({height:'187px'});i=1}else{$(".area_box").animate({height:'32px'}); i=0}//显示隐藏选项
	})
$(".box").click(function(){//点击选项：切换背景颜色
	$(this).css("background-color","#CCCCCC").siblings().css("background-color","#fff");
	$(".chenge").html($(this).html());//点击选项：替换文本
	})
</script>
</body>
</html>
